#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Realization.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class BehavioredClassifier;
class Interface;

/// <summary>
/// InterfaceRealization
/// An InterfaceRealization is a specialized realization relationship between a
/// BehavioredClassifier and an Interface. This relationship signifies that the
/// realizing BehavioredClassifier conforms to the contract specified by the
/// Interface.
/// </summary>
class UMLMODEL_EXPORT InterfaceRealization : public Realization {

public: // Constructors and destructors
    explicit InterfaceRealization(const QString& umlType="uml::InterfaceRealization");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// contract getter
    /// References the Interface specifying the conformance contract.
    /// </summary>
    shared_ptr<Interface> contract() const;

    /// <summary>
    /// contract setter
    /// References the Interface specifying the conformance contract.
    /// </summary>
    void setContract(shared_ptr<Interface> value);

    /// <summary>
    /// implementingClassifier getter
    /// References the BehavioredClassifier that owns this InterfaceRealization, i.e.,
    /// the BehavioredClassifier that realizes the Interface to which it refers.
    /// </summary>
    shared_ptr<BehavioredClassifier> implementingClassifier() const;

    /// <summary>
    /// implementingClassifier setter
    /// References the BehavioredClassifier that owns this InterfaceRealization, i.e.,
    /// the BehavioredClassifier that realizes the Interface to which it refers.
    /// </summary>
    void setImplementingClassifier(shared_ptr<BehavioredClassifier> value);

private: // Fields
    /// <summary>
    /// contract
    /// References the Interface specifying the conformance contract.
    /// </summary>
    shared_ptr<Interface> contract_;

    /// <summary>
    /// implementingClassifier
    /// References the BehavioredClassifier that owns this InterfaceRealization, i.e.,
    /// the BehavioredClassifier that realizes the Interface to which it refers.
    /// </summary>
    shared_ptr<BehavioredClassifier> implementingClassifier_;

};

} // namespace uml
